Conversation
| @@ -0,0 +1,22 @@ | |||
| export default function initializeAutocompleteToggle() { | |||
| const searchField = document.querySelector('#search_field'); | |||
There was a problem hiding this comment.
Is there a reason you aren't using Stimulus for this? All of the other JS for this app uses Stimulus.
There was a problem hiding this comment.
I wrote this in Stimulus first. I needed to copy down the Blacklight template for the search bar in order to insert the Stimulus targets, controller, etc. into the markup. I got the feedback that this seemed messier than writing vanilla JS. With vanilla JS, there was no need to copy down the Blacklight component. So I rewrote it this way.
There was a problem hiding this comment.
By making that choice, you are binding to selectors that are not guaranteed to be stable between versions of blacklight/arclight. This seems more dangerous to me, even though it might be less code.
There was a problem hiding this comment.
This makes sense, thanks for the feedback. The team decided put this to draft for now as we learn more about what the stakeholders actually want from this feature.
2651206 to
f853b94
Compare
Closes #864